<html>
<body onpaste="pasteCount++;">
<script>
var pasteCount = 0;
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
</script>

<div id="console" style="width:200%;height:200%;">
<div style="border:2px solid black;width:25%;" onclick="finished();"> This test checks that middle clicking the scroll bars doesn't trigger a paste event (See <a href="https://bugs.webkit.org/show_bug.cgi?id=33062">Bug 33062</a>). If the test passes, the output will be a single line that says PASS. To run the tests manually, middle click each of the scroll bars, then click this paragraph.</div>
<input type="text" id="input-field" onpaste="pasteCount++;"/>
</div>
<script>
var i = document.getElementById('input-field');
i.focus();

if (window.eventSender) {
    eventSender.mouseMoveTo(window.innerWidth - 1, 1);
    eventSender.mouseDown(1);
    eventSender.mouseUp(1);
    eventSender.mouseMoveTo(1, window.innerHeight - 1);
    eventSender.mouseDown(1);
    eventSender.mouseUp(1);
    finished();
}

function finished()
{
    if (pasteCount == 0) {
        document.getElementById('console').innerHTML = "PASS";
    } else {
        document.getElementById('console').innerHTML = "FAIL";
    }
    if (window.testRunner) {
        testRunner.notifyDone();
    }
}
</script>
</body>
</html>
